#ifndef WORKER_MGR_H_
#define WORKER_MGR_H_
#include "conf.h"

C_CODE_BEGIN
struct worker_mgr;
struct worker;
typedef struct worker* (*worker_creator)( const char* name , bool  );

EXPORT_FUNC struct worker_mgr* worker_mgr_create();
EXPORT_FUNC void worker_mgr_destroy( struct worker_mgr* );

EXPORT_FUNC void worker_mgr_register( struct worker_mgr* , const char* , worker_creator );

/*
 * this function is typically called when the user want to use its native way to extend the
 * framework , and the user should call it when the plug-in has been uninstalled .
 */
EXPORT_FUNC void worker_mgr_unregister( struct worker_mgr* , const char* );

EXPORT_FUNC struct worker* worker_mgr_spawn_worker( struct worker_mgr * , const char* worker_type , const char* thread_name , bool detach );

C_CODE_END

#endif // WORKER_MGR_H_